<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>

<script type="text/javascript">
function goPagination(pageIndex){
	$("#page_pageIndex").val(pageIndex);
	var form = $("#f_search_abuse");
	form.submit();
}
function pass(){
	var idx = sns.getCheckbox("ck_abuses");
	if(idx == false){
		alert('please choose at least one');
		return;
	}
	if(idx.indexOf(",") != -1){
		alert('Only can choose one');
		return;
	}
	var url = ctx + "/admin/abuse/pass.do?";
	$.ajax({
		url : url,
		data : "abuseId="+idx,
		success : function(data){
			alert(data);
			window.location.href = window.location.href;
		},
		error : function(){}
		
	});
}
function reject(){
	var idx = sns.getCheckbox("ck_abuses");
	if(idx == false){
		alert('please choose at least one');
		return;
	}
	if(idx.indexOf(",") != -1){
		alert('Only can choose one');
		return;
	}
	var url = ctx + "/admin/abuse/reject.do?";
	$.ajax({
		url : url,
		data : "abuseId="+idx,
		success : function(data){
			alert(data);
			window.location.href = window.location.href;
		},
		error : function(){}
		
	});
}
</script>
<div class="bu">
<button onclick="pass()" class="btn3_mouseout" onmouseover="this.className='btn3_mouseover'"
onmouseout="this.className='btn3_mouseout'" onmousedown="this.className='btn3_mousedown'"
onmouseup="this.className='btn3_mouseup'"title="UPDATE"><fmt:message key="common.audit.pass"/></button>&nbsp;&nbsp;
<button onclick="reject()" class="btn3_mouseout" onmouseover="this.className='btn3_mouseover'"
onmouseout="this.className='btn3_mouseout'" onmousedown="this.className='btn3_mousedown'"
onmouseup="this.className='btn3_mouseup'"title="UPDATE"><fmt:message key="common.audit.reject"/></button>&nbsp;&nbsp;
</div>
<div style="display:none">
	<form id="f_search_abuse" action="abuse.do" method="post">
		<input type="text" id="page_pageIndex" name="page.pageIndex" value='<c:out value="${page.pageIndex }"/>'/>
		<input type="text" id="page_pageSize" name="page.pageSize" value='<c:out value="${page.pageSize }"/>'/>
		<input type="text" id="page_totalCount" name="page.totalCount" value='<c:out value="${page.totalCount }"/>'/>
	</form>
</div>
<div>
<table id="t_abuse_list" width="100%"  border="0" cellpadding="0" cellspacing="0" class="pub_list01">
	<thead>
		<tr>
			<th width="50px" class="tdCenter">
			</th>
			<th width="75px" class="tdCenter">举报类型</th>
			<th width="75px" class="tdCenter">举报对象</th>
			<th width="75px" class="tdCenter">审核状况</th>
			<th width="75px" class="tdCenter">举报人</th>
			<th width="75px" class="tdCenter">举报时间</th>
			<th width="75px" class="tdCenter">审核人</th>
		</tr>
	</thead>
	<tbody>
		<c:forEach var="abuse" items="${page.items}" varStatus="status">
		<tr>
			<td class="tdCenter">
				<input type="checkbox" name="ck_abuses" id="ck_<c:out value='${abuse.abuseId}' />" value="${abuse.abuseId}"></input>
			</td>
			<td class="tdCenter">
				<c:if test="${abuse.abuseType == 1}">
					帖子
				</c:if>
				<c:if test="${abuse.abuseType  == 3}">
					博客
				</c:if>
			</td>
			<td class="tdCenter">
				<c:out value="${abuse.entity}"></c:out>
			</td>
			<td class="tdCenter">
				<c:if test="${abuse.audit == 1}">
					未处理
				</c:if>
				<c:if test="${abuse.audit == 2}">
					继续处理
				</c:if>
				<c:if test="${abuse.audit == 3}">
					举报成功
				</c:if>
				<c:if test="${abuse.audit == 4}">
					举报失败
				</c:if>
			</td>
			<td class="tdCenter">
				<c:out value="${abuse.reporter}"></c:out>
			</td>
			<td class="tdCenter">
				<c:out value="${abuse.reportTime}"></c:out>
			</td>
			<td class="tdCenter">
				<c:out value="${abuse.auditor}"></c:out>
			</td>
		</tr>
		</c:forEach>
	</tbody>
</table>
<jsp:include page="/common/pager.jsp" />
</div>
<br/>
<div class="bu">
<button onclick="pass()" class="btn3_mouseout" onmouseover="this.className='btn3_mouseover'"
onmouseout="this.className='btn3_mouseout'" onmousedown="this.className='btn3_mousedown'"
onmouseup="this.className='btn3_mouseup'"title="UPDATE"><fmt:message key="common.audit.pass"/></button>&nbsp;&nbsp;
<button onclick="reject()" class="btn3_mouseout" onmouseover="this.className='btn3_mouseover'"
onmouseout="this.className='btn3_mouseout'" onmousedown="this.className='btn3_mousedown'"
onmouseup="this.className='btn3_mouseup'"title="UPDATE"><fmt:message key="common.audit.reject"/></button>&nbsp;&nbsp;
</div>
